<%@ page language="java" contentType="text/html; charset=UTF-8"
	isELIgnored="false" pageEncoding="UTF-8"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
<%@ taglib prefix="s" uri="/struts-tags" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<script type="text/javascript"
	src="<%=request.getContextPath()%>/js/jquery/jquery-1.8.3.min.js"></script>
<script type="text/javascript"
	src="<%=request.getContextPath()%>/js/common/ajaxJquery.js"></script>

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>集群管理中心</title>
<style>
.yjdiv {
	text-align: center;
	border: 2px solid #a1a1a1;
	background: #dddddd;
	width: 600px;
	height: 485px;
	border-radius: 25px;
	-webkit-border-radius: 25px;
	-moz-border-radius: 25px;
	-ms-border-radius: 25px;
	-o-border-radius: 25px;
}

.bgdiv {
	text-align: center;
	border: 0px solid #a1a1a1;
	background: #dddddd;
	width: 600px;
	height: 200px;
	border-radius: 25px;
	overflow:auto;
	-webkit-border-radius: 25px;
	-moz-border-radius: 25px;
	-ms-border-radius: 25px;
	-o-border-radius: 25px;
}

.btn1 {
	display: block;
	background: none repeat scroll 0 0 #7EC0EE;
	white-space: nowrap;
	width: 200px;
	height: 20px;
	line-height: 20px;
	font-size: 17px;
	color: red;
	font-weight: 500;
	cursor: pointer;
	text-align: center;
	border: 0px solid;
	margin: auto;
	padding: 10px 40px;
	padding-left: 0px;
	padding-right: 0px;
	border-radius: 10px;
	-webkit-border-radius: 10px;
	-moz-border-radius: 10px;
	-ms-border-radius: 10px;
	-o-border-radius: 10px;
}

.btn_a {
	display: block;
	float: left;
	width: 50px;
	height: 20px;
	background: #5CACEE;
	border: 1px solid black;
	cursor: hand;
	margin-right: 3px;
	color: black;
}

.btn_a:HOVER {
	background: #7EC0EE;
}
</style>


<script>

function redisFlushAll(){
	ajaxSubmit('<%=request.getContextPath()%>/monitor/redisFlushAll.action','',fnSuccess,fnError);
}
function reloadBaseCode(){
	ajaxSubmit('<%=request.getContextPath()%>/monitor/reloadBaseCode.action','',fnSuccess,fnError);
}

function reloadWebSite(){
	ajaxSubmit('<%=request.getContextPath()%>/monitor/reloadWebSite.action','', fnSuccess, fnError);
}
	
function reRegisterZK(){
	ajaxSubmit('<%=request.getContextPath()%>/monitor/reRegisterZK.action','', fnSuccess, fnError);
}
	function fnSuccess(data) {
		alert(data);
	}
	function fnError(data) {
		alert(data);
	}
</script>
</head>
<body>
	<div class="yjdiv">
	<br/>
		<div class="bgdiv">
			<table>
				<tr>
					<td align="left"><font color="green">代理集群应用数量</font>:</td>
					<td align="left">${fn:length(vo.appNames) }</td>
				</tr>
				<tr>
					<td align="left" colspan="2">
					<s:iterator value="vo.appNames" var="app">
						${app }&nbsp;|
					</s:iterator>
					</td>
				</tr>
				<tr>
					<td align="left"><font color="green">分布式任务类型数量</font>：</td>
					<td align="left">${fn:length(vo.taskList) }</td>
				</tr>
				<tr>
					<td align="left" colspan="2">
					<s:iterator value="vo.taskList" var="task">
						${task }&nbsp;|
					</s:iterator>
					</td>
				</tr>
			</table>
		</div>
		<br/>
		<div class="btn1" onclick="redisFlushAll();">清空缓存</div>
		<br>
		<div class="btn1" onclick="reRegisterZK();">重新注册zookeeper</div>
		<br>
		<div class="btn1" onclick="reloadBaseCode();">重新加载BaseCode</div>
		<br>
		<div class="btn1" onclick="reloadWebSite();">重新加载代理网站</div>
	</div>
<div><font color="red">attention:<br/>1、重新注册zookeeper的速度可能比较慢，这需要重新发布任务路径，暂停所有执行任务。（慎用）<br/>2、清空缓存能清空所有死锁，但是所有ip池的数据也清空。</font></div>
</body>
</html>